﻿// TimeSelector shows a date selector dialog when clicked
define([
    'Wjs/ui/widgets/tools/Tool'
],
function (Tool) {
    'use strict';

    var type = 'timeSelector',
    typeManager = Wjs.typeManager,
    TimeSelector = typeManager.getType(type);

    if (TimeSelector) { // It has been already loaded
        return TimeSelector;
    }

    TimeSelector = Wjs.typeBuilder.define({
        base: Tool,
        construct: function (conf, parent) {

            TimeSelector.base.constructor.call(this, conf, parent);

            this.addClass('wjs-time-selector wjs-field-tool');
        },

        type: type,

        clickHandler: function () {
            alert('time coming soon!');
        }
    });

    typeManager.registerType(TimeSelector);

    return TimeSelector;
});